package com.service;

import java.util.HashMap;
import java.util.Map;

public class Data {
	static Map<String, String[]> map;

	static {
		map = new HashMap();
		map.put("X", new String[] { "com.service.AService",
				"com.service.BService" });
		map.put("Y", new String[] { "com.service.AService",
				"com.service.CService", "com.service.EService" });
		map.put("Z", new String[] { "com.service.AService",
				"com.service.BService", "com.service.CService",
				"com.service.DService" });
	}

	public static String yetkiKontrol(String kullanici, String serviceName) {
		String[] servisler = map.get(kullanici);
		String calisacakServis = null;
		for (String servis : servisler) {
			if (servis.contains(serviceName)) {
				calisacakServis = servis;
				break;
			}
		}
		return calisacakServis;
	}

}
